Collaborators: Shane Blowes, Jon Chase, Helmut Hillebrand, Michael Burrows, Amanda Bates, Uli Brose, Benoit Gauzens, Laura Antao Assistance: Katherine Lew, Josef Hauser
library(data.table) # for handling large datasets
library(ggplot2) # for some plotting
#library(lme4)
library(nlme) # for ME models
library(beanplot) # for beanplots
library(maps) # for map
library(ggeffects) # marginal effect plots
library(gridExtra) # to combine ggplots together
library(grid) # to combine ggplots together
library(gridExtra)
# tell RStudio to use project root directory as the root for this notebook. Needed since we are storing code in a separate directory.
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
# Turnover and covariates assembled by turnover_vs_temperature_prep.Rmd
trends <- fread('output/turnover_w_covariates.csv.gz')
# set realm order
trends[, REALM := factor(REALM, levels = c('Freshwater', 'Marine', 'Terrestrial'), ordered = FALSE)]
# group Marine invertebrates/plants in with All
trends[, taxa_mod2 := taxa_mod]
trends[taxa_mod == 'Marine invertebrates/plants', taxa_mod2 := 'All']
Log-transform some variables, then center and scale.
trends[, tempave.sc := scale(tempave)]
trends[, tempave_metab.sc := scale(tempave_metab)]
trends[, seas.sc := scale(seas)]
trends[, microclim.sc := scale(log(microclim))]
trends[, temptrend.sc := scale(temptrend)]
trends[, temptrend_abs.sc := scale(log(abs(temptrend)))]
trends[, npp.sc := scale(log(npp))]
trends[, mass.sc := scale(log(mass_mean_weight))]
trends[, speed.sc := scale(log(speed_mean_weight+1))]
trends[, lifespan.sc := scale(log(lifespan_mean_weight))]
trends[, thermal_bias.sc := scale(thermal_bias)]
trends[, consumerfrac.sc := scale(consfrac)]
trends[, endothermfrac.sc := scale(endofrac)]
trends[, nspp.sc := scale(log(Nspp))]
trends[, human.sc := scale(human)]
Do the variables look ok?
# histograms to examine
cexmain = 0.6
par(mfrow = c(3,5))
invisible(trends[, hist(tempave.sc, main = 'Environmental temperature (°C)', cex.main = cexmain)])
invisible(trends[, hist(tempave_metab.sc, main = 'Metabolic temperature (°C)', cex.main = cexmain)])
invisible(trends[, hist(seas.sc, main = 'Seasonality (°C)', cex.main = cexmain)])
invisible(trends[, hist(microclim.sc, main = 'log Microclimates (°C)', cex.main = cexmain)])
invisible(trends[, hist(temptrend.sc, main = 'Temperature trend (°C/yr)', cex.main = cexmain)])
invisible(trends[, hist(temptrend_abs.sc, main = 'log abs(Temperature trend) (°C/yr)', cex.main = cexmain)])
invisible(trends[, hist(mass.sc, main = 'log Mass (g)', cex.main = cexmain)])
invisible(trends[, hist(speed.sc, main = 'log Speed (km/hr)', cex.main = cexmain)])
invisible(trends[, hist(lifespan.sc, main = 'log Lifespan (yr)', cex.main = cexmain)])
invisible(trends[, hist(consumerfrac.sc, main = 'Consumers (fraction)', cex.main = cexmain)])
invisible(trends[, hist(endothermfrac.sc, main = 'Endotherms (fraction)', cex.main = cexmain)])
invisible(trends[, hist(nspp.sc, main = 'log Species richness', cex.main = cexmain)])
invisible(trends[, hist(thermal_bias.sc, main = 'Thermal bias (°C)', cex.main = cexmain)])
invisible(trends[, hist(npp.sc, main = 'log Net primary productivity', cex.main = cexmain)])
invisible(trends[, hist(human.sc, main = 'Human impact score', cex.main = cexmain)])
Check correlations among variables. Pearson’s r is on the lower diagonal.
panel.cor <- function(x, y, digits = 2, prefix = "", cex.cor, ...)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- cor(x, y, use = 'pairwise.complete.obs')
txt <- format(c(r, 0.123456789), digits = digits)[1]
txt <- paste0(prefix, txt)
if(missing(cex.cor)) cex.cor <- 0.8/strwidth(txt)
text(0.5, 0.5, txt) #, cex = cex.cor * r)
}
pairs(formula = ~ REALM + tempave.sc + tempave_metab.sc + seas.sc + microclim.sc + temptrend.sc + temptrend_abs.sc + mass.sc + speed.sc + lifespan.sc + consumerfrac.sc + endothermfrac.sc + nspp.sc + thermal_bias.sc + npp.sc + human.sc, data = trends, gap = 1/10, cex = 0.2, col = '#00000022', lower.panel = panel.cor)
Mass and lifespan look tightly correlated, but r only 0.56…? Tempave_metab and lifespan don’t look tightly correlated, but r= -0.81 Tempave_metab and speed don’t look tightly correlated, but r= -0.83 Lifespan and speed don’t look tightly correlated, but r = 0.73
Examine how many data points are available
# the cases we can compare
apply(trends[, .(Jtutrend, REALM, tempave.sc, tempave_metab.sc, seas.sc, microclim.sc, temptrend.sc, mass.sc, speed.sc, lifespan.sc, consumerfrac.sc, endothermfrac.sc, nspp.sc, thermal_bias.sc, npp.sc, human.sc)], MARGIN = 2, FUN = function(x) sum(!is.na(x)))
Jtutrend REALM tempave.sc tempave_metab.sc seas.sc microclim.sc
53013 53013 49916 49916 49916 51834
temptrend.sc mass.sc speed.sc lifespan.sc consumerfrac.sc endothermfrac.sc
49916 52820 52689 51540 47534 53013
nspp.sc thermal_bias.sc npp.sc human.sc
53013 49371 52863 53013
i <- trends[, complete.cases(Jtutrend, temptrend.sc, tempave_metab.sc, REALM, seas.sc, microclim.sc, npp.sc, mass.sc, speed.sc, lifespan.sc, consumerfrac.sc, thermal_bias.sc)]
cat('Overall:\n')
Overall:
sum(i)
[1] 43585
Try combinations of
And choose the one with lowest AIC (not run: takes a long time)
# fit models for variance structure
fixed <- formula(Jtutrend ~ REALM + tempave_metab.sc + seas.sc + microclim.sc + npp.sc + temptrend_abs.sc +
mass.sc + speed.sc + lifespan.sc + consumerfrac.sc + thermal_bias.sc)
i <- trends[, complete.cases(Jtutrend, REALM, tempave_metab.sc, seas.sc, microclim.sc, npp.sc, temptrend_abs.sc,
mass.sc, speed.sc, lifespan.sc, consumerfrac.sc, thermal_bias.sc)]
mods <- vector('list', 0)
mods[[1]] <- gls(fixed, data = trends[i,])
mods[[2]] <- gls(fixed, data = trends[i,], weights = varPower(-0.5, ~nyrBT))
mods[[3]] <- gls(fixed, data = trends[i,], weights = varPower(0.5, ~ abs(temptrend)))
mods[[4]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2, control = lmeControl(opt = "optim"))
mods[[5]] <- lme(fixed, data = trends[i,], random = ~1|STUDY_ID, control = lmeControl(opt = "optim"))
mods[[6]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2/STUDY_ID, control = lmeControl(opt = "optim"))
mods[[7]] <- lme(fixed, data = trends[i,], random = ~1|STUDY_ID/rarefyID, control = lmeControl(opt = "optim"))
mods[[8]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2/STUDY_ID/rarefyID, control = lmeControl(opt = "optim"))
mods[[9]] <- lme(fixed, data = trends[i,], random = ~temptrend_abs.sc | taxa_mod)
mods[[10]] <- lme(fixed, data = trends[i,], random = ~temptrend_abs.sc | STUDY_ID)
mods[[11]] <- lme(fixed, data = trends[i,], random = ~temptrend_abs.sc | taxa_mod2/STUDY_ID, control = lmeControl(opt = "optim"))
mods[[12]] <- lme(fixed, data = trends[i,], random = list(STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1)) # includes overdispersion. new formula so that random slope is only for study level (not enough data to extend to rarefyID).
mods[[13]] <- lme(fixed, data = trends[i,], random = list(taxa_mod2 = ~ temptrend_abs.sc, STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1)) # 30+ min to fit
mods[[14]] <- lme(fixed, data = trends[i,], random = ~1|STUDY_ID, weights = varPower(-0.5, ~nyrBT))
mods[[15]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2, weights = varPower(-0.5, ~nyrBT))
mods[[16]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2/STUDY_ID, weights = varPower(-0.5, ~nyrBT))
mods[[17]] <- lme(fixed, data = trends[i,], random = ~1|STUDY_ID/rarefyID, weights = varPower(-0.5, ~nyrBT))
mods[[18]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2/STUDY_ID/rarefyID, weights = varPower(-0.5, ~nyrBT))
mods[[19]] <- lme(fixed, data = trends[i,], random = ~temptrend_abs.sc|STUDY_ID, weights = varPower(-0.5, ~nyrBT))
mods[[20]] <- lme(fixed, data = trends[i,], random = list(STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1), weights = varPower(-0.5, ~nyrBT))
mods[[21]] <- lme(fixed, data = trends[i,], random = list(taxa_mod2 = ~ temptrend_abs.sc, STUDY_ID = ~ 1), weights = varPower(-0.5, ~nyrBT))
mods[[22]] <- lme(fixed, data = trends[i,], random = list(taxa_mod2 = ~ temptrend_abs.sc, STUDY_ID = ~ 1, rarefyID = ~1), weights = varPower(-0.5, ~nyrBT))
mods[[23]] <- lme(fixed, data = trends[i,], random = list(taxa_mod2 = ~ temptrend_abs.sc, STUDY_ID = ~ temptrend_abs.sc), weights = varPower(-0.5, ~nyrBT)) # singular precision warning with lmeControl(opt = 'optim') and convergence error without
mods[[24]] <- lme(fixed, data = trends[i,], random = list(taxa_mod2 = ~ temptrend_abs.sc, STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1), weights = varPower(-0.5, ~nyrBT)) # singular precision warning with lmeControl(opt = 'optim') and convergence error without
mods[[25]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2, weights = varPower(-0.5, ~abs(temptrend)))
mods[[26]] <- lme(fixed, data = trends[i,], random = ~1|STUDY_ID, weights = varPower(-0.5, ~abs(temptrend)))
mods[[27]] <- lme(fixed, data = trends[i,], random = ~1|STUDY_ID/rarefyID, weights = varPower(-0.5, ~abs(temptrend)))
mods[[28]] <- lme(fixed, data = trends[i,], random = ~1|taxa_mod2/STUDY_ID/rarefyID, weights = varPower(-0.5, ~abs(temptrend)))
mods[[29]] <- lme(fixed, data = trends[i,], random = ~temptrend_abs.sc|STUDY_ID, weights = varPower(-0.5, ~abs(temptrend)))
mods[[30]] <- lme(fixed, data = trends[i,], random = ~temptrend_abs.sc|taxa_mod2/STUDY_ID, weights = varPower(-0.5, ~abs(temptrend)), control = lmeControl(opt = "optim"))
mods[[31]] <- lme(fixed, data = trends[i,], random = list(STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1), weights = varPower(-0.5, ~abs(temptrend)))
mods[[32]] <- lme(fixed, data = trends[i,], random = list(taxa_mod2 = ~ temptrend_abs.sc, STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1), weights = varPower(-0.5, ~abs(temptrend)), control = lmeControl(opt = "optim")) # singular precision warning
aics <- sapply(mods, AIC)
minaics <- aics - min(aics)
minaics
which.min(aics)
Chooses the random slopes (temptrend_abs) & intercepts for STUDY_ID, overdispersion, and variance scaled to number of years. We haven’t dealt with potential testing on the boundary issues here yet.
world <- map_data('world')
ggplot(world, aes(x = long, y = lat, group = group)) +
geom_polygon(fill = 'lightgray', color = 'white') +
geom_point(data = trends, aes(rarefyID_x, rarefyID_y, group = REALM, color = REALM), size = 0.5, alpha = 0.4) +
scale_color_brewer(palette="Set1")
Mostly northern hemisphere, but spread all over. No so much in Africa or much of Asia.
Lines are ggplot smoother fits by realm.
Strong trends with temperature change, but trends are pretty symmetric around no trend in temperature, which implies warming or cooling drives similar degree of community turnover. Some indication of less turnover for larger organisms (mass) Higher turnover on land with higher seasonality? More turnover for shorter-lived organisms? No really clear differences among realms.
i <- trends[, !duplicated(rarefyID)]; sum(i)
[1] 53013
par(mfrow=c(5,3))
beanplot(rarefyID_y ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Latitude (degN)', ll = 0.05)
beanplot(tempave ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Temperature (degC)', ll = 0.05)
beanplot(tempave_metab ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Metabolic Temperature (degC)', ll = 0.05, bw = 'nrd0') # nrd0 bandwidth to calculation gap
beanplot(seas ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Seasonality (degC)', ll = 0.05)
beanplot(microclim ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Microclimates (degC)', ll = 0.05)
log="y" selected
beanplot(temptrend ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Temperature trend (degC/yr)', ll = 0.05)
beanplot(mass_mean_weight ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Mass (g)', ll = 0.05, log = 'y')
beanplot(speed_mean_weight +1 ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Speed (km/hr)', ll = 0.05, log = 'y')
beanplot(lifespan_mean_weight ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Lifespan (yr)', ll = 0.05, log = 'y')
#beanplot(consfrac ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Consumers (fraction)', ll = 0.05, log = '') # too sparse
#beanplot(endofrac ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Endotherms (fraction)', ll = 0.05, log = '') # too sparse
beanplot(Nspp ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Number of species', ll = 0.05, log = 'y')
beanplot(thermal_bias ~ REALM, data = trends[i & !is.na(thermal_bias),], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Thermal bias (degC)', ll = 0.05)
beanplot(npp ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'NPP', ll = 0.05)
log="y" selected
beanplot(human ~ REALM, data = trends[i,], what = c(1,1,1,1), col = c("#CAB2D6", "#33A02C", "#B2DF8A"), border = "#CAB2D6", ylab = 'Human impact score', ll = 0.05)
Marine are in generally warmer locations (seawater doesn’t freeze) Marine have much lower seasonality. Marine and freshwater have some very small masses (plankton), but much of dataset is similar to terrestrial. Marine has a lot of slow, crawling organisms, but land has plants. Land also has birds (fast).
Try static covariates plus interactions of abs temperature trend with each covariate:
Except for thermal bias: interact with temperature trend (not abs)
i <- trends[, complete.cases(Jtutrend, REALM, tempave.sc, tempave_metab.sc, seas.sc, microclim.sc, temptrend.sc, temptrend_abs.sc,
mass.sc, speed.sc, lifespan.sc, consumerfrac.sc, endothermfrac.sc, nspp.sc, thermal_bias.sc, npp.sc, human.sc)]
randef <- list(STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1)
varef <- varPower(-0.5, ~nyrBT)
if(file.exists('temp/modTfull1.rds')){
modTfull1 <- readRDS('temp/modTfull1.rds')
} else {
modTfull1 <- lme(Jtutrend ~ temptrend_abs.sc*REALM +
temptrend_abs.sc*tempave.sc +
temptrend_abs.sc*tempave_metab.sc +
temptrend_abs.sc*seas.sc +
temptrend_abs.sc*microclim.sc +
temptrend_abs.sc*mass.sc +
temptrend_abs.sc*speed.sc +
temptrend_abs.sc*lifespan.sc +
temptrend_abs.sc*consumerfrac.sc +
temptrend_abs.sc*endothermfrac.sc +
temptrend_abs.sc*nspp.sc +
temptrend.sc*thermal_bias.sc +
temptrend_abs.sc*npp.sc +
temptrend_abs.sc*human.sc*REALM,
random = randef, weights = varef, data = trends[i,], method = 'REML')
saveRDS(modTfull1, file = 'temp/modTfull1.rds')
}
summary(modTfull1)
Linear mixed-effects model fit by REML
Data: trends[i, ]
Random effects:
Formula: ~temptrend_abs.sc | STUDY_ID
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.05028541 (Intr)
temptrend_abs.sc 0.01934781 0.555
Formula: ~1 | rarefyID %in% STUDY_ID
(Intercept) Residual
StdDev: 0.001189033 0.3037859
Variance function:
Structure: Power of variance covariate
Formula: ~nyrBT
Parameter estimates:
power
-1.246996
Fixed effects: Jtutrend ~ temptrend_abs.sc * REALM + temptrend_abs.sc * tempave.sc + temptrend_abs.sc * tempave_metab.sc + temptrend_abs.sc * seas.sc + temptrend_abs.sc * microclim.sc + temptrend_abs.sc * mass.sc + temptrend_abs.sc * speed.sc + temptrend_abs.sc * lifespan.sc + temptrend_abs.sc * consumerfrac.sc + temptrend_abs.sc * endothermfrac.sc + temptrend_abs.sc * nspp.sc + temptrend.sc * thermal_bias.sc + temptrend_abs.sc * npp.sc + temptrend_abs.sc * human.sc * REALM
Correlation:
(Intr) tmpt_. REALMMr REALMTr tmpv.s tmpv_. ses.sc mcrcl. mss.sc
temptrend_abs.sc 0.368
REALMMarine -0.918 -0.337
REALMTerrestrial -0.882 -0.333 0.807
tempave.sc 0.000 -0.007 -0.013 -0.003
tempave_metab.sc 0.053 0.015 -0.042 -0.045 -0.278
seas.sc -0.037 -0.004 0.053 -0.003 0.271 -0.083
microclim.sc -0.008 0.002 0.013 -0.010 0.049 0.067 0.170
mass.sc 0.019 0.000 -0.004 0.001 -0.002 -0.550 -0.046 -0.015
speed.sc 0.021 0.007 -0.034 -0.032 -0.003 0.170 -0.075 -0.032 -0.135
lifespan.sc 0.037 0.021 -0.024 -0.043 -0.037 0.752 0.094 0.047 -0.806
consumerfrac.sc -0.067 -0.057 0.074 0.342 -0.014 -0.090 0.004 0.007 0.063
endothermfrac.sc 0.169 0.077 -0.087 -0.349 0.080 -0.167 0.048 -0.002 0.014
nspp.sc -0.023 0.000 -0.002 -0.014 -0.047 -0.021 -0.033 -0.056 -0.156
temptrend.sc -0.005 -0.009 0.006 0.008 -0.060 -0.018 -0.044 -0.013 0.015
thermal_bias.sc 0.030 -0.006 -0.044 -0.008 0.759 -0.044 -0.152 -0.131 0.039
npp.sc 0.004 0.000 -0.006 -0.001 -0.320 0.241 -0.256 -0.220 -0.011
human.sc -0.166 -0.023 0.157 0.146 0.017 -0.005 0.008 0.017 0.006
temptrend_abs.sc:REALMMarine -0.349 -0.953 0.369 0.315 0.007 -0.009 0.014 0.001 0.006
temptrend_abs.sc:REALMTerrestrial -0.327 -0.874 0.301 0.367 -0.007 -0.016 -0.020 -0.012 0.012
temptrend_abs.sc:tempave.sc 0.001 -0.004 -0.002 -0.003 0.099 -0.059 0.036 -0.028 -0.035
temptrend_abs.sc:tempave_metab.sc 0.009 0.032 -0.004 -0.005 0.033 0.330 0.018 0.085 -0.207
temptrend_abs.sc:seas.sc 0.012 -0.029 -0.008 -0.023 0.153 0.024 0.227 0.027 -0.039
temptrend_abs.sc:microclim.sc -0.004 -0.032 0.001 -0.002 0.012 0.099 0.059 0.312 -0.033
temptrend_abs.sc:mass.sc -0.001 -0.002 0.007 0.009 -0.016 -0.272 -0.038 -0.024 0.459
temptrend_abs.sc:speed.sc -0.001 -0.004 0.000 -0.005 -0.009 0.028 -0.028 0.002 -0.014
temptrend_abs.sc:lifespan.sc 0.009 0.040 -0.003 -0.010 0.000 0.378 0.049 0.026 -0.385
temptrend_abs.sc:consumerfrac.sc -0.050 -0.058 0.050 0.124 -0.008 -0.067 -0.005 -0.003 0.037
spd.sc lfspn. cnsmr. endth. nspp.s tmptr. thrm_. npp.sc hmn.sc
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc 0.265
consumerfrac.sc -0.163 -0.123
endothermfrac.sc 0.083 -0.014 -0.440
nspp.sc -0.050 0.098 0.014 0.057
temptrend.sc -0.011 -0.012 0.011 0.002 0.015
thermal_bias.sc 0.019 -0.067 0.001 -0.006 -0.106 -0.001
npp.sc -0.021 0.059 -0.047 -0.090 -0.162 -0.012 -0.137
human.sc 0.004 0.007 0.013 -0.002 -0.015 0.008 0.016 -0.029
temptrend_abs.sc:REALMMarine -0.011 -0.015 0.060 -0.051 -0.007 0.006 0.005 -0.008 0.023
temptrend_abs.sc:REALMTerrestrial -0.010 -0.022 0.139 -0.130 -0.015 0.009 0.001 0.013 0.020
temptrend_abs.sc:tempave.sc -0.031 0.005 -0.005 0.024 -0.002 -0.071 0.016 -0.031 -0.004
temptrend_abs.sc:tempave_metab.sc 0.074 0.300 -0.034 -0.060 -0.025 0.001 0.090 0.027 0.003
temptrend_abs.sc:seas.sc -0.029 0.042 0.016 0.002 -0.006 -0.029 0.098 -0.178 -0.003
temptrend_abs.sc:microclim.sc 0.008 0.022 0.002 -0.032 0.005 0.003 -0.029 -0.141 0.002
temptrend_abs.sc:mass.sc -0.043 -0.385 0.037 0.006 -0.056 0.019 0.014 0.007 0.009
temptrend_abs.sc:speed.sc 0.180 0.051 -0.041 0.027 -0.024 -0.006 0.010 0.012 0.012
temptrend_abs.sc:lifespan.sc 0.095 0.475 -0.057 -0.035 0.040 -0.015 -0.014 0.016 -0.001
temptrend_abs.sc:consumerfrac.sc -0.055 -0.077 0.278 -0.127 0.008 0.009 -0.009 -0.018 -0.011
tm_.:REALMM tm_.:REALMT tmptrnd_bs.sc:t. t_.:_. tmptrnd_bs.sc:ss.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial 0.829
temptrend_abs.sc:tempave.sc 0.003 0.003
temptrend_abs.sc:tempave_metab.sc -0.023 -0.030 -0.639
temptrend_abs.sc:seas.sc 0.054 -0.050 0.206 0.017
temptrend_abs.sc:microclim.sc 0.042 -0.002 -0.039 0.010 0.048
temptrend_abs.sc:mass.sc 0.015 0.027 -0.059 -0.424 -0.029
temptrend_abs.sc:speed.sc -0.024 -0.008 -0.042 0.093 -0.037
temptrend_abs.sc:lifespan.sc -0.033 -0.040 -0.003 0.633 0.055
temptrend_abs.sc:consumerfrac.sc 0.071 0.267 0.023 -0.114 -0.029
tmptrnd_bs.sc:mc. tmptrnd_bs.sc:ms. tmptrnd_bs.sc:sp.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc 0.014
temptrend_abs.sc:speed.sc -0.038 -0.059
temptrend_abs.sc:lifespan.sc 0.013 -0.805 0.150
temptrend_abs.sc:consumerfrac.sc 0.008 0.062 -0.234
tmptrnd_bs.sc:l. tmptrnd_bs.sc:c. tmptrnd_bs.sc:nd.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:speed.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:consumerfrac.sc -0.147
tmptrnd_bs.sc:ns. tm.:_. tmptrnd_bs.sc:np. tmptrnd_bs.sc:h.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:speed.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:consumerfrac.sc
REALMM: REALMT: t_.:REALMM:
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:speed.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:consumerfrac.sc
[ reached getOption("max.print") -- omitted 9 rows ]
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-7.58461466 -0.34521721 0.05131203 0.55413461 6.93144917
Number of Observations: 43585
Number of Groups:
STUDY_ID rarefyID %in% STUDY_ID
250 43585
if(file.exists('temp/modTfull1simp.rds')){
modTfull1simp <- readRDS('temp/modTfull1simp.rds')
} else {
require(MASS) # for stepAIC
modTfull1ml <- update(modTfull1, method = 'ML')
modTfull1simp <- stepAIC(modTfull1ml, direction = 'backward')
saveRDS(modTfull1simp, file = 'temp/modTfull1simp.rds')
}
Start: AIC=-130792.1
Jtutrend ~ temptrend_abs.sc * REALM + temptrend_abs.sc * tempave.sc +
temptrend_abs.sc * tempave_metab.sc + temptrend_abs.sc *
seas.sc + temptrend_abs.sc * microclim.sc + temptrend_abs.sc *
mass.sc + temptrend_abs.sc * speed.sc + temptrend_abs.sc *
lifespan.sc + temptrend_abs.sc * consumerfrac.sc + temptrend_abs.sc *
endothermfrac.sc + temptrend_abs.sc * nspp.sc + temptrend.sc *
thermal_bias.sc + temptrend_abs.sc * npp.sc + temptrend_abs.sc *
human.sc * REALM
Df AIC
- temptrend_abs.sc:tempave.sc 1 -130794
- temptrend_abs.sc:endothermfrac.sc 1 -130794
- temptrend_abs.sc:consumerfrac.sc 1 -130793
- temptrend_abs.sc:speed.sc 1 -130793
<none> -130792
- temptrend_abs.sc:REALM:human.sc 2 -130792
- temptrend.sc:thermal_bias.sc 1 -130790
- temptrend_abs.sc:npp.sc 1 -130789
- temptrend_abs.sc:seas.sc 1 -130789
- temptrend_abs.sc:tempave_metab.sc 1 -130783
- temptrend_abs.sc:lifespan.sc 1 -130777
- temptrend_abs.sc:microclim.sc 1 -130775
- temptrend_abs.sc:mass.sc 1 -130760
- temptrend_abs.sc:nspp.sc 1 -130381
Step: AIC=-130793.9
Jtutrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc +
seas.sc + microclim.sc + mass.sc + speed.sc + lifespan.sc +
consumerfrac.sc + endothermfrac.sc + nspp.sc + temptrend.sc +
thermal_bias.sc + npp.sc + human.sc + temptrend_abs.sc:REALM +
temptrend_abs.sc:tempave_metab.sc + temptrend_abs.sc:seas.sc +
temptrend_abs.sc:microclim.sc + temptrend_abs.sc:mass.sc +
temptrend_abs.sc:speed.sc + temptrend_abs.sc:lifespan.sc +
temptrend_abs.sc:consumerfrac.sc + temptrend_abs.sc:endothermfrac.sc +
temptrend_abs.sc:nspp.sc + temptrend.sc:thermal_bias.sc +
temptrend_abs.sc:npp.sc + temptrend_abs.sc:human.sc + REALM:human.sc +
temptrend_abs.sc:REALM:human.sc
Df AIC
- temptrend_abs.sc:endothermfrac.sc 1 -130796
- temptrend_abs.sc:consumerfrac.sc 1 -130795
- temptrend_abs.sc:speed.sc 1 -130795
<none> -130794
- temptrend_abs.sc:REALM:human.sc 2 -130793
- tempave.sc 1 -130792
- temptrend.sc:thermal_bias.sc 1 -130792
- temptrend_abs.sc:npp.sc 1 -130791
- temptrend_abs.sc:seas.sc 1 -130790
- temptrend_abs.sc:tempave_metab.sc 1 -130780
- temptrend_abs.sc:lifespan.sc 1 -130779
- temptrend_abs.sc:microclim.sc 1 -130777
- temptrend_abs.sc:mass.sc 1 -130761
- temptrend_abs.sc:nspp.sc 1 -130383
Step: AIC=-130795.6
Jtutrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc +
seas.sc + microclim.sc + mass.sc + speed.sc + lifespan.sc +
consumerfrac.sc + endothermfrac.sc + nspp.sc + temptrend.sc +
thermal_bias.sc + npp.sc + human.sc + temptrend_abs.sc:REALM +
temptrend_abs.sc:tempave_metab.sc + temptrend_abs.sc:seas.sc +
temptrend_abs.sc:microclim.sc + temptrend_abs.sc:mass.sc +
temptrend_abs.sc:speed.sc + temptrend_abs.sc:lifespan.sc +
temptrend_abs.sc:consumerfrac.sc + temptrend_abs.sc:nspp.sc +
temptrend.sc:thermal_bias.sc + temptrend_abs.sc:npp.sc +
temptrend_abs.sc:human.sc + REALM:human.sc + temptrend_abs.sc:REALM:human.sc
Df AIC
- temptrend_abs.sc:speed.sc 1 -130796
- temptrend_abs.sc:consumerfrac.sc 1 -130796
<none> -130796
- temptrend_abs.sc:REALM:human.sc 2 -130795
- tempave.sc 1 -130794
- temptrend.sc:thermal_bias.sc 1 -130793
- temptrend_abs.sc:npp.sc 1 -130792
- temptrend_abs.sc:seas.sc 1 -130792
- endothermfrac.sc 1 -130786
- temptrend_abs.sc:tempave_metab.sc 1 -130782
- temptrend_abs.sc:lifespan.sc 1 -130781
- temptrend_abs.sc:microclim.sc 1 -130778
- temptrend_abs.sc:mass.sc 1 -130763
- temptrend_abs.sc:nspp.sc 1 -130382
Step: AIC=-130795.9
Jtutrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc +
seas.sc + microclim.sc + mass.sc + speed.sc + lifespan.sc +
consumerfrac.sc + endothermfrac.sc + nspp.sc + temptrend.sc +
thermal_bias.sc + npp.sc + human.sc + temptrend_abs.sc:REALM +
temptrend_abs.sc:tempave_metab.sc + temptrend_abs.sc:seas.sc +
temptrend_abs.sc:microclim.sc + temptrend_abs.sc:mass.sc +
temptrend_abs.sc:lifespan.sc + temptrend_abs.sc:consumerfrac.sc +
temptrend_abs.sc:nspp.sc + temptrend.sc:thermal_bias.sc +
temptrend_abs.sc:npp.sc + temptrend_abs.sc:human.sc + REALM:human.sc +
temptrend_abs.sc:REALM:human.sc
Df AIC
- temptrend_abs.sc:consumerfrac.sc 1 -130797
<none> -130796
- temptrend_abs.sc:REALM:human.sc 2 -130795
- speed.sc 1 -130795
- tempave.sc 1 -130794
- temptrend.sc:thermal_bias.sc 1 -130793
- temptrend_abs.sc:npp.sc 1 -130793
- temptrend_abs.sc:seas.sc 1 -130792
- endothermfrac.sc 1 -130786
- temptrend_abs.sc:tempave_metab.sc 1 -130783
- temptrend_abs.sc:lifespan.sc 1 -130782
- temptrend_abs.sc:microclim.sc 1 -130779
- temptrend_abs.sc:mass.sc 1 -130764
- temptrend_abs.sc:nspp.sc 1 -130379
Step: AIC=-130796.6
Jtutrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc +
seas.sc + microclim.sc + mass.sc + speed.sc + lifespan.sc +
consumerfrac.sc + endothermfrac.sc + nspp.sc + temptrend.sc +
thermal_bias.sc + npp.sc + human.sc + temptrend_abs.sc:REALM +
temptrend_abs.sc:tempave_metab.sc + temptrend_abs.sc:seas.sc +
temptrend_abs.sc:microclim.sc + temptrend_abs.sc:mass.sc +
temptrend_abs.sc:lifespan.sc + temptrend_abs.sc:nspp.sc +
temptrend.sc:thermal_bias.sc + temptrend_abs.sc:npp.sc +
temptrend_abs.sc:human.sc + REALM:human.sc + temptrend_abs.sc:REALM:human.sc
Df AIC
- consumerfrac.sc 1 -130798
<none> -130797
- temptrend_abs.sc:REALM:human.sc 2 -130796
- speed.sc 1 -130795
- tempave.sc 1 -130794
- temptrend.sc:thermal_bias.sc 1 -130794
- temptrend_abs.sc:npp.sc 1 -130793
- temptrend_abs.sc:seas.sc 1 -130793
- endothermfrac.sc 1 -130787
- temptrend_abs.sc:tempave_metab.sc 1 -130785
- temptrend_abs.sc:lifespan.sc 1 -130784
- temptrend_abs.sc:microclim.sc 1 -130780
- temptrend_abs.sc:mass.sc 1 -130765
- temptrend_abs.sc:nspp.sc 1 -130381
Step: AIC=-130797.6
Jtutrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc +
seas.sc + microclim.sc + mass.sc + speed.sc + lifespan.sc +
endothermfrac.sc + nspp.sc + temptrend.sc + thermal_bias.sc +
npp.sc + human.sc + temptrend_abs.sc:REALM + temptrend_abs.sc:tempave_metab.sc +
temptrend_abs.sc:seas.sc + temptrend_abs.sc:microclim.sc +
temptrend_abs.sc:mass.sc + temptrend_abs.sc:lifespan.sc +
temptrend_abs.sc:nspp.sc + temptrend.sc:thermal_bias.sc +
temptrend_abs.sc:npp.sc + temptrend_abs.sc:human.sc + REALM:human.sc +
temptrend_abs.sc:REALM:human.sc
Df AIC
<none> -130798
- speed.sc 1 -130797
- temptrend_abs.sc:REALM:human.sc 2 -130796
- tempave.sc 1 -130796
- temptrend.sc:thermal_bias.sc 1 -130795
- temptrend_abs.sc:npp.sc 1 -130794
- temptrend_abs.sc:seas.sc 1 -130794
- endothermfrac.sc 1 -130789
- temptrend_abs.sc:tempave_metab.sc 1 -130786
- temptrend_abs.sc:lifespan.sc 1 -130785
- temptrend_abs.sc:microclim.sc 1 -130781
- temptrend_abs.sc:mass.sc 1 -130766
- temptrend_abs.sc:nspp.sc 1 -130382
summary(modTfull1simp)
Linear mixed-effects model fit by maximum likelihood
Data: trends[i, ]
Random effects:
Formula: ~temptrend_abs.sc | STUDY_ID
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.04935417 (Intr)
temptrend_abs.sc 0.01813999 0.582
Formula: ~1 | rarefyID %in% STUDY_ID
(Intercept) Residual
StdDev: 0.001168172 0.3039957
Variance function:
Structure: Power of variance covariate
Formula: ~nyrBT
Parameter estimates:
power
-1.247572
Fixed effects: Jtutrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc + seas.sc + microclim.sc + mass.sc + speed.sc + lifespan.sc + endothermfrac.sc + nspp.sc + temptrend.sc + thermal_bias.sc + npp.sc + human.sc + temptrend_abs.sc:REALM + temptrend_abs.sc:tempave_metab.sc + temptrend_abs.sc:seas.sc + temptrend_abs.sc:microclim.sc + temptrend_abs.sc:mass.sc + temptrend_abs.sc:lifespan.sc + temptrend_abs.sc:nspp.sc + temptrend.sc:thermal_bias.sc + temptrend_abs.sc:npp.sc + temptrend_abs.sc:human.sc + REALM:human.sc + temptrend_abs.sc:REALM:human.sc
Correlation:
(Intr) tmpt_. REALMMr REALMTr tmpv.s tmpv_. ses.sc mcrcl. mss.sc
temptrend_abs.sc 0.372
REALMMarine -0.918 -0.344
REALMTerrestrial -0.916 -0.336 0.834
tempave.sc 0.004 0.006 -0.015 -0.006
tempave_metab.sc 0.053 0.023 -0.038 -0.023 -0.289
seas.sc -0.037 -0.001 0.053 -0.006 0.268 -0.084
microclim.sc -0.005 0.007 0.012 -0.017 0.049 0.063 0.171
mass.sc 0.022 0.000 -0.009 -0.020 0.006 -0.551 -0.045 -0.015
speed.sc 0.014 0.005 -0.025 0.022 -0.003 0.153 -0.071 -0.034 -0.128
lifespan.sc 0.033 0.024 -0.016 -0.006 -0.048 0.750 0.095 0.046 -0.807
endothermfrac.sc 0.145 0.009 -0.055 -0.222 0.126 -0.213 0.071 0.018 0.037
nspp.sc -0.027 -0.009 -0.002 -0.014 -0.041 -0.012 -0.032 -0.053 -0.161
temptrend.sc -0.007 -0.013 0.006 0.007 -0.050 -0.017 -0.041 -0.014 0.010
thermal_bias.sc 0.036 0.008 -0.047 -0.017 0.760 -0.054 -0.156 -0.135 0.043
npp.sc 0.001 -0.002 -0.003 0.016 -0.322 0.237 -0.255 -0.221 -0.009
human.sc -0.168 -0.019 0.159 0.154 0.018 -0.004 0.008 0.017 0.006
temptrend_abs.sc:REALMMarine -0.353 -0.955 0.377 0.318 0.000 -0.010 0.012 -0.003 0.004
temptrend_abs.sc:REALMTerrestrial -0.331 -0.896 0.309 0.349 -0.030 -0.022 -0.028 -0.025 0.009
temptrend_abs.sc:tempave_metab.sc 0.026 0.083 -0.009 -0.018 0.102 0.364 0.049 0.079 -0.303
temptrend_abs.sc:seas.sc 0.019 -0.013 -0.011 -0.041 0.126 0.025 0.223 0.029 -0.028
temptrend_abs.sc:microclim.sc -0.005 -0.038 0.002 -0.002 0.017 0.100 0.060 0.314 -0.036
temptrend_abs.sc:mass.sc 0.002 -0.002 0.003 -0.004 -0.008 -0.274 -0.037 -0.025 0.457
temptrend_abs.sc:lifespan.sc 0.010 0.051 0.001 0.003 -0.011 0.367 0.049 0.022 -0.385
temptrend_abs.sc:nspp.sc -0.008 0.023 -0.002 0.002 -0.027 0.015 0.001 0.013 -0.071
temptrend.sc:thermal_bias.sc 0.009 0.019 -0.009 -0.007 0.067 0.032 0.000 -0.032 -0.002
temptrend_abs.sc:npp.sc 0.002 -0.057 -0.007 0.013 -0.116 0.095 -0.162 -0.164 0.013
temptrend_abs.sc:human.sc -0.069 0.174 0.065 0.062 -0.005 -0.009 0.005 0.006 0.009
REALMMarine:human.sc 0.169 0.020 -0.160 -0.154 -0.020 0.004 -0.016 -0.024 -0.005
REALMTerrestrial:human.sc 0.168 0.019 -0.159 -0.153 -0.032 0.007 -0.022 -0.006 -0.002
temptrend_abs.sc:REALMMarine:human.sc 0.069 -0.172 -0.065 -0.062 0.001 0.009 -0.009 -0.009 -0.009
temptrend_abs.sc:REALMTerrestrial:human.sc 0.069 -0.174 -0.065 -0.062 0.012 0.007 -0.003 -0.005 -0.008
spd.sc lfspn. endth. nspp.s tmptr. thrm_. npp.sc hmn.sc
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc 0.246
endothermfrac.sc 0.024 -0.054
nspp.sc -0.043 0.108 0.051
temptrend.sc -0.009 -0.007 -0.003 0.013
thermal_bias.sc 0.016 -0.076 0.029 -0.100 0.003
npp.sc -0.032 0.053 -0.130 -0.161 -0.013 -0.138
human.sc 0.004 0.008 0.006 -0.015 0.008 0.015 -0.029
temptrend_abs.sc:REALMMarine -0.002 -0.012 0.005 -0.003 0.008 -0.003 -0.006 0.020
temptrend_abs.sc:REALMTerrestrial -0.002 -0.018 0.018 0.000 0.015 -0.024 0.020 0.019
temptrend_abs.sc:tempave_metab.sc 0.047 0.385 0.034 -0.009 -0.049 0.107 0.003 -0.001
temptrend_abs.sc:seas.sc -0.017 0.035 0.055 0.001 -0.011 0.086 -0.178 -0.004
temptrend_abs.sc:microclim.sc 0.015 0.025 -0.043 0.003 0.000 -0.026 -0.142 0.002
temptrend_abs.sc:mass.sc -0.031 -0.382 0.024 -0.060 0.013 0.017 0.008 0.010
temptrend_abs.sc:lifespan.sc 0.063 0.466 -0.029 0.054 -0.010 -0.027 0.011 -0.004
temptrend_abs.sc:nspp.sc 0.029 0.076 -0.031 0.303 0.015 -0.051 -0.017 -0.012
temptrend.sc:thermal_bias.sc 0.008 0.003 0.009 -0.009 -0.402 -0.015 -0.003 -0.006
temptrend_abs.sc:npp.sc 0.000 0.011 -0.063 -0.034 -0.016 -0.044 0.367 -0.012
temptrend_abs.sc:human.sc -0.007 -0.009 0.000 -0.003 0.006 -0.009 -0.012 0.410
REALMMarine:human.sc -0.004 -0.009 -0.006 0.013 -0.008 -0.014 0.018 -0.998
REALMTerrestrial:human.sc -0.001 -0.013 -0.011 0.018 -0.007 -0.020 0.027 -0.998
temptrend_abs.sc:REALMMarine:human.sc 0.007 0.008 0.000 0.000 -0.006 0.006 0.008 -0.409
temptrend_abs.sc:REALMTerrestrial:human.sc 0.007 0.008 0.002 0.004 -0.006 0.011 0.013 -0.407
tm_.:REALMM tm_.:REALMT t_.:_. tmptrnd_bs.sc:s. tmptrnd_bs.sc:mc.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial 0.855
temptrend_abs.sc:tempave_metab.sc -0.050 -0.101
temptrend_abs.sc:seas.sc 0.046 -0.086 0.168
temptrend_abs.sc:microclim.sc 0.045 0.002 -0.012 0.058
temptrend_abs.sc:mass.sc 0.012 0.018 -0.630 -0.016 0.008
temptrend_abs.sc:lifespan.sc -0.033 -0.039 0.829 0.044 0.020
temptrend_abs.sc:nspp.sc -0.056 -0.041 0.083 -0.056 -0.173
temptrend.sc:thermal_bias.sc -0.017 -0.020 0.071 -0.031 -0.036
temptrend_abs.sc:npp.sc 0.042 0.056 0.046 -0.168 -0.212
temptrend_abs.sc:human.sc -0.165 -0.151 -0.030 -0.019 0.039
REALMMarine:human.sc -0.020 -0.019 0.001 -0.001 -0.005
REALMTerrestrial:human.sc -0.020 -0.018 -0.001 -0.002 0.001
temptrend_abs.sc:REALMMarine:human.sc 0.163 0.151 0.030 0.010 -0.038
temptrend_abs.sc:REALMTerrestrial:human.sc 0.164 0.150 0.023 0.016 -0.027
tmptrnd_bs.sc:ms. tmptrnd_bs.sc:l. tmptrnd_bs.sc:ns. tm.:_.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:lifespan.sc -0.815
temptrend_abs.sc:nspp.sc -0.224 0.233
temptrend.sc:thermal_bias.sc -0.004 -0.004 0.003
temptrend_abs.sc:npp.sc -0.032 0.042 -0.188 0.001
temptrend_abs.sc:human.sc 0.049 -0.026 -0.033 -0.004
REALMMarine:human.sc -0.009 0.003 0.010 0.005
REALMTerrestrial:human.sc -0.008 0.002 0.013 0.004
temptrend_abs.sc:REALMMarine:human.sc -0.049 0.026 0.029 0.005
temptrend_abs.sc:REALMTerrestrial:human.sc -0.045 0.021 0.034 0.006
tmptrnd_bs.sc:np. tmptrnd_bs.sc:h. REALMM: REALMT: t_.:REALMM:
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:nspp.sc
temptrend.sc:thermal_bias.sc
temptrend_abs.sc:npp.sc
temptrend_abs.sc:human.sc -0.033
REALMMarine:human.sc 0.008 -0.409
REALMTerrestrial:human.sc 0.012 -0.409 0.997
temptrend_abs.sc:REALMMarine:human.sc 0.023 -0.998 0.410 0.408
temptrend_abs.sc:REALMTerrestrial:human.sc 0.029 -0.993 0.406 0.406 0.991
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-7.59895515 -0.34513651 0.05160027 0.55556600 6.91372100
Number of Observations: 43585
Number of Groups:
STUDY_ID rarefyID %in% STUDY_ID
250 43585
resids <- resid(modTfull1simpreml)
preds <- getData(modTfull1simpreml)
col = '#00000033'
cex = 0.5
par(mfrow = c(4,3))
boxplot(resids ~ preds$REALM, cex = cex, col = col)
plot(preds$temptrend_abs.sc, resids, cex = cex, col = col)
plot(preds$temptrend.sc, resids, cex = cex, col = col)
plot(preds$tempave.sc, resids, cex = cex, col = col)
plot(preds$microclim.sc, resids, cex = cex, col = col)
plot(preds$npp.sc, resids, cex = cex, col = col)
plot(preds$speed.sc, resids, cex = cex, col = col)
plot(preds$mass.sc, resids, cex = cex, col = col)
plot(preds$consumerfrac.sc, resids, cex = cex, col = col)
plot(preds$thermal_bias.sc, resids, cex = cex, col = col)
i2 <- trends[, complete.cases(Jbetatrend, REALM, tempave.sc, tempave_metab.sc, seas.sc, microclim.sc,
temptrend.sc, temptrend_abs.sc, mass.sc, speed.sc, lifespan.sc,
consumerfrac.sc, endothermfrac.sc, nspp.sc, thermal_bias.sc, npp.sc, human.sc)]
i3 <- trends[, complete.cases(Horntrend, REALM, tempave.sc, tempave_metab.sc, seas.sc, microclim.sc,
temptrend.sc, temptrend_abs.sc, mass.sc, speed.sc, lifespan.sc,
consumerfrac.sc, endothermfrac.sc, nspp.sc, thermal_bias.sc, npp.sc, human.sc)]
randef <- list(STUDY_ID = ~ temptrend_abs.sc, rarefyID = ~1)
varef <- varPower(-0.5, ~nyrBT)
# full models
if(file.exists('temp/modTfullJbeta.rds')){
modTfullJbeta <- readRDS('temp/modTfullJbeta.rds')
} else {
modTfullJbeta <- lme(Jbetatrend ~ temptrend_abs.sc*REALM +
temptrend_abs.sc*tempave.sc +
temptrend_abs.sc*tempave_metab.sc +
temptrend_abs.sc*seas.sc +
temptrend_abs.sc*microclim.sc +
temptrend_abs.sc*mass.sc +
temptrend_abs.sc*speed.sc +
temptrend_abs.sc*lifespan.sc +
temptrend_abs.sc*consumerfrac.sc +
temptrend_abs.sc*endothermfrac.sc +
temptrend_abs.sc*nspp.sc +
temptrend.sc*thermal_bias.sc +
temptrend_abs.sc*npp.sc +
temptrend_abs.sc*human.sc*REALM,
random = randef, weights = varef, data = trends[i2,], method = 'REML')
saveRDS(modTfullJbeta, file = 'temp/modTfullJbeta.rds')
}
if(file.exists('temp/modTfullHorn.rds')){
modTfullHorn <- readRDS('temp/modTfullHorn.rds')
} else {
modTfullHorn <- lme(Horntrend ~ temptrend_abs.sc*REALM +
temptrend_abs.sc*tempave.sc +
temptrend_abs.sc*tempave_metab.sc +
temptrend_abs.sc*seas.sc +
temptrend_abs.sc*microclim.sc +
temptrend_abs.sc*mass.sc +
temptrend_abs.sc*speed.sc +
temptrend_abs.sc*lifespan.sc +
temptrend_abs.sc*consumerfrac.sc +
temptrend_abs.sc*endothermfrac.sc +
temptrend_abs.sc*nspp.sc +
temptrend.sc*thermal_bias.sc +
temptrend_abs.sc*npp.sc +
temptrend_abs.sc*human.sc*REALM,
random = randef, weights = varef, data = trends[i3,], method = 'REML')
saveRDS(modTfullHorn, file = 'temp/modTfullHorn.rds')
}
summary(modTfullJbeta)
Linear mixed-effects model fit by REML
Data: trends[i2, ]
Random effects:
Formula: ~temptrend_abs.sc | STUDY_ID
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.06574154 (Intr)
temptrend_abs.sc 0.02529340 0.519
Formula: ~1 | rarefyID %in% STUDY_ID
(Intercept) Residual
StdDev: 0.002266703 0.3555714
Variance function:
Structure: Power of variance covariate
Formula: ~nyrBT
Parameter estimates:
power
-1.375398
Fixed effects: Jbetatrend ~ temptrend_abs.sc * REALM + temptrend_abs.sc * tempave.sc + temptrend_abs.sc * tempave_metab.sc + temptrend_abs.sc * seas.sc + temptrend_abs.sc * microclim.sc + temptrend_abs.sc * mass.sc + temptrend_abs.sc * speed.sc + temptrend_abs.sc * lifespan.sc + temptrend_abs.sc * consumerfrac.sc + temptrend_abs.sc * endothermfrac.sc + temptrend_abs.sc * nspp.sc + temptrend.sc * thermal_bias.sc + temptrend_abs.sc * npp.sc + temptrend_abs.sc * human.sc * REALM
Correlation:
(Intr) tmpt_. REALMMr REALMTr tmpv.s tmpv_. ses.sc mcrcl. mss.sc spd.sc lfspn. cnsmr. endth. nspp.s
temptrend_abs.sc 0.344
REALMMarine -0.918 -0.315
REALMTerrestrial -0.886 -0.314 0.812
tempave.sc -0.002 -0.006 -0.009 -0.006
tempave_metab.sc 0.042 0.013 -0.032 -0.036 -0.264
seas.sc -0.026 -0.002 0.038 -0.002 0.282 -0.083
microclim.sc -0.004 0.002 0.010 -0.007 0.062 0.066 0.188
mass.sc 0.018 0.002 -0.005 -0.003 0.000 -0.550 -0.041 -0.013
speed.sc 0.016 0.006 -0.025 -0.022 -0.005 0.180 -0.080 -0.037 -0.138
lifespan.sc 0.027 0.016 -0.017 -0.033 -0.036 0.757 0.095 0.049 -0.801 0.280
consumerfrac.sc -0.050 -0.051 0.062 0.323 -0.034 -0.067 0.003 0.013 0.053 -0.123 -0.103
endothermfrac.sc 0.157 0.075 -0.079 -0.320 0.057 -0.125 0.044 0.004 0.023 0.061 -0.012 -0.427
nspp.sc -0.020 0.001 0.000 -0.009 -0.048 -0.034 -0.026 -0.059 -0.150 -0.048 0.085 0.006 0.043
temptrend.sc -0.004 -0.008 0.005 0.007 -0.065 -0.019 -0.048 -0.017 0.015 -0.011 -0.012 0.012 0.003 0.020
thermal_bias.sc 0.022 -0.006 -0.033 -0.008 0.757 -0.033 -0.152 -0.127 0.038 0.018 -0.065 -0.006 -0.003 -0.112
npp.sc 0.003 0.001 -0.007 -0.007 -0.322 0.246 -0.265 -0.223 -0.013 -0.023 0.063 -0.059 -0.080 -0.165
human.sc -0.131 -0.012 0.123 0.116 0.020 -0.009 0.013 0.017 0.003 0.001 0.005 0.010 0.001 -0.009
temptrend_abs.sc:REALMMarine -0.327 -0.953 0.347 0.299 0.006 -0.008 0.010 0.000 0.004 -0.010 -0.012 0.054 -0.049 -0.007
temptrend_abs.sc:REALMTerrestrial -0.307 -0.878 0.282 0.346 -0.004 -0.014 -0.015 -0.009 0.007 -0.007 -0.017 0.134 -0.132 -0.013
temptrend_abs.sc:tempave.sc -0.001 -0.006 -0.001 -0.003 0.108 -0.063 0.050 -0.026 -0.033 -0.030 0.003 -0.011 0.017 -0.003
temptrend_abs.sc:tempave_metab.sc 0.008 0.027 -0.005 -0.004 0.031 0.353 0.014 0.086 -0.218 0.088 0.319 -0.022 -0.053 -0.028
temptrend_abs.sc:seas.sc 0.010 -0.024 -0.005 -0.014 0.158 0.026 0.232 0.025 -0.036 -0.029 0.041 0.028 0.007 -0.010
temptrend_abs.sc:microclim.sc -0.002 -0.023 0.000 -0.001 0.010 0.101 0.054 0.277 -0.029 0.009 0.018 0.003 -0.028 -0.001
temptrend_abs.sc:mass.sc 0.001 0.004 0.004 0.006 -0.013 -0.290 -0.034 -0.020 0.496 -0.054 -0.409 0.034 0.007 -0.060
temptrend_abs.sc:speed.sc 0.000 -0.002 -0.001 -0.005 -0.006 0.038 -0.029 0.004 -0.023 0.222 0.070 -0.036 0.024 -0.025
temptrend_abs.sc:lifespan.sc 0.007 0.031 -0.004 -0.008 -0.002 0.409 0.050 0.025 -0.409 0.122 0.510 -0.047 -0.038 0.038
temptrend_abs.sc:consumerfrac.sc -0.049 -0.055 0.047 0.121 -0.007 -0.057 -0.003 -0.003 0.030 -0.053 -0.067 0.251 -0.134 0.005
tmptr. thrm_. npp.sc hmn.sc tm_.:REALMM tm_.:REALMT tmptrnd_bs.sc:t. t_.:_. tmptrnd_bs.sc:ss.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc -0.001
npp.sc -0.015 -0.135
human.sc 0.009 0.015 -0.034
temptrend_abs.sc:REALMMarine 0.006 0.005 -0.007 0.012
temptrend_abs.sc:REALMTerrestrial 0.008 0.002 0.008 0.010 0.833
temptrend_abs.sc:tempave.sc -0.077 0.008 -0.033 -0.003 0.005 0.002
temptrend_abs.sc:tempave_metab.sc 0.002 0.098 0.030 -0.001 -0.020 -0.024 -0.649
temptrend_abs.sc:seas.sc -0.033 0.101 -0.180 0.000 0.044 -0.035 0.245 -0.011
temptrend_abs.sc:microclim.sc 0.001 -0.022 -0.126 0.001 0.032 -0.003 -0.024 -0.001 0.059
temptrend_abs.sc:mass.sc 0.019 0.015 0.005 0.011 0.009 0.014 -0.053 -0.407 -0.027
temptrend_abs.sc:speed.sc -0.004 0.012 0.012 0.011 -0.020 -0.005 -0.044 0.090 -0.046
temptrend_abs.sc:lifespan.sc -0.016 -0.014 0.021 -0.005 -0.025 -0.031 -0.007 0.628 0.053
temptrend_abs.sc:consumerfrac.sc 0.008 -0.005 -0.019 -0.007 0.072 0.258 0.013 -0.090 -0.017
tmptrnd_bs.sc:mc. tmptrnd_bs.sc:ms. tmptrnd_bs.sc:sp. tmptrnd_bs.sc:l. tmptrnd_bs.sc:c. tmptrnd_bs.sc:nd.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc 0.015
temptrend_abs.sc:speed.sc -0.047 -0.055
temptrend_abs.sc:lifespan.sc 0.016 -0.790 0.150
temptrend_abs.sc:consumerfrac.sc 0.010 0.041 -0.188 -0.120
tmptrnd_bs.sc:ns. tm.:_. tmptrnd_bs.sc:np. tmptrnd_bs.sc:h. REALMM: REALMT: t_.:REALMM:
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:speed.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:consumerfrac.sc
[ reached getOption("max.print") -- omitted 9 rows ]
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-6.8341663 -0.2345669 0.1396972 0.6505144 7.5323730
Number of Observations: 43585
Number of Groups:
STUDY_ID rarefyID %in% STUDY_ID
250 43585
summary(modTfullHorn)
Linear mixed-effects model fit by REML
Data: trends[i3, ]
Random effects:
Formula: ~temptrend_abs.sc | STUDY_ID
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.06615737 (Intr)
temptrend_abs.sc 0.02037063 0.557
Formula: ~1 | rarefyID %in% STUDY_ID
(Intercept) Residual
StdDev: 0.00442701 0.3182813
Variance function:
Structure: Power of variance covariate
Formula: ~nyrBT
Parameter estimates:
power
-1.239152
Fixed effects: Horntrend ~ temptrend_abs.sc * REALM + temptrend_abs.sc * tempave.sc + temptrend_abs.sc * tempave_metab.sc + temptrend_abs.sc * seas.sc + temptrend_abs.sc * microclim.sc + temptrend_abs.sc * mass.sc + temptrend_abs.sc * speed.sc + temptrend_abs.sc * lifespan.sc + temptrend_abs.sc * consumerfrac.sc + temptrend_abs.sc * endothermfrac.sc + temptrend_abs.sc * nspp.sc + temptrend.sc * thermal_bias.sc + temptrend_abs.sc * npp.sc + temptrend_abs.sc * human.sc * REALM
Correlation:
(Intr) tmpt_. REALMMr REALMTr tmpv.s tmpv_. ses.sc mcrcl. mss.sc spd.sc lfspn. cnsmr. endth. nspp.s
temptrend_abs.sc 0.336
REALMMarine -0.905 -0.302
REALMTerrestrial -0.876 -0.303 0.786
tempave.sc -0.002 -0.005 -0.008 -0.003
tempave_metab.sc 0.050 0.014 -0.037 -0.047 -0.337
seas.sc -0.039 -0.003 0.051 0.003 0.258 -0.087
microclim.sc -0.007 0.005 0.012 -0.008 0.027 0.057 0.138
mass.sc 0.017 -0.001 -0.004 0.002 -0.010 -0.525 -0.046 -0.009
speed.sc 0.017 0.005 -0.030 -0.026 -0.017 0.165 -0.089 -0.041 -0.133
lifespan.sc 0.034 0.021 -0.021 -0.040 -0.035 0.730 0.092 0.037 -0.802 0.256
consumerfrac.sc -0.051 -0.051 0.046 0.335 -0.014 -0.066 -0.003 0.010 0.052 -0.129 -0.101
endothermfrac.sc 0.163 0.075 -0.079 -0.340 0.100 -0.159 0.042 0.000 0.013 0.065 -0.012 -0.421
nspp.sc -0.023 -0.001 0.000 -0.008 -0.044 -0.021 -0.028 -0.044 -0.163 -0.043 0.100 0.010 0.049
temptrend.sc -0.004 -0.007 0.005 0.008 -0.060 -0.016 -0.043 -0.013 0.016 -0.008 -0.012 0.010 0.001 0.018
thermal_bias.sc 0.029 -0.004 -0.039 -0.013 0.726 -0.049 -0.151 -0.144 0.037 0.016 -0.067 0.007 0.006 -0.107
npp.sc 0.007 -0.002 -0.008 -0.007 -0.313 0.241 -0.273 -0.259 -0.010 -0.006 0.056 -0.040 -0.077 -0.154
human.sc -0.144 0.005 0.134 0.127 0.019 -0.009 0.014 0.022 0.005 0.000 0.006 0.013 0.000 -0.012
temptrend_abs.sc:REALMMarine -0.316 -0.951 0.339 0.285 0.004 -0.007 0.010 -0.003 0.006 -0.008 -0.014 0.052 -0.050 -0.005
temptrend_abs.sc:REALMTerrestrial -0.297 -0.869 0.268 0.338 -0.006 -0.021 -0.018 -0.014 0.014 -0.007 -0.023 0.123 -0.125 -0.012
temptrend_abs.sc:tempave.sc 0.001 0.002 -0.003 -0.001 0.087 -0.056 0.006 -0.035 -0.038 -0.029 0.004 -0.005 0.024 -0.007
temptrend_abs.sc:tempave_metab.sc 0.007 0.026 -0.001 -0.008 0.036 0.301 0.030 0.087 -0.190 0.063 0.281 -0.023 -0.054 -0.023
temptrend_abs.sc:seas.sc 0.013 -0.019 -0.011 -0.020 0.117 0.031 0.181 0.007 -0.032 -0.024 0.037 0.014 -0.007 -0.015
temptrend_abs.sc:microclim.sc -0.003 -0.033 0.001 -0.003 -0.007 0.098 0.043 0.248 -0.026 0.017 0.012 -0.002 -0.032 0.016
temptrend_abs.sc:mass.sc -0.001 -0.005 0.006 0.009 -0.025 -0.249 -0.036 -0.018 0.443 -0.034 -0.368 0.028 0.002 -0.051
temptrend_abs.sc:speed.sc -0.002 -0.006 0.003 -0.003 -0.008 0.019 -0.019 0.010 -0.006 0.120 0.036 -0.026 0.018 -0.022
temptrend_abs.sc:lifespan.sc 0.008 0.037 0.000 -0.009 0.006 0.350 0.046 0.016 -0.368 0.078 0.456 -0.043 -0.034 0.036
temptrend_abs.sc:consumerfrac.sc -0.046 -0.059 0.048 0.104 -0.006 -0.057 -0.013 -0.006 0.035 -0.034 -0.069 0.225 -0.103 0.005
tmptr. thrm_. npp.sc hmn.sc tm_.:REALMM tm_.:REALMT tmptrnd_bs.sc:t. t_.:_. tmptrnd_bs.sc:ss.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc -0.005
npp.sc -0.016 -0.130
human.sc 0.009 0.014 -0.038
temptrend_abs.sc:REALMMarine 0.005 0.003 -0.005 -0.005
temptrend_abs.sc:REALMTerrestrial 0.009 -0.003 0.013 -0.004 0.820
temptrend_abs.sc:tempave.sc -0.068 0.028 -0.014 -0.003 -0.005 0.004
temptrend_abs.sc:tempave_metab.sc 0.000 0.084 0.012 0.002 -0.015 -0.032 -0.660
temptrend_abs.sc:seas.sc -0.025 0.091 -0.158 -0.003 0.044 -0.075 0.135 0.055
temptrend_abs.sc:microclim.sc 0.009 -0.034 -0.134 0.000 0.042 -0.002 -0.061 0.014 0.037
temptrend_abs.sc:mass.sc 0.021 0.007 0.009 0.008 0.016 0.032 -0.064 -0.408 -0.024
temptrend_abs.sc:speed.sc -0.005 0.009 0.016 0.011 -0.026 -0.005 -0.046 0.092 -0.039
temptrend_abs.sc:lifespan.sc -0.016 -0.008 0.012 -0.001 -0.031 -0.038 -0.006 0.620 0.051
temptrend_abs.sc:consumerfrac.sc 0.010 -0.003 -0.007 -0.009 0.064 0.275 0.024 -0.107 -0.060
tmptrnd_bs.sc:mc. tmptrnd_bs.sc:ms. tmptrnd_bs.sc:sp. tmptrnd_bs.sc:l. tmptrnd_bs.sc:c. tmptrnd_bs.sc:nd.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc 0.016
temptrend_abs.sc:speed.sc -0.043 -0.059
temptrend_abs.sc:lifespan.sc 0.011 -0.804 0.148
temptrend_abs.sc:consumerfrac.sc 0.011 0.068 -0.205 -0.136
tmptrnd_bs.sc:ns. tm.:_. tmptrnd_bs.sc:np. tmptrnd_bs.sc:h. REALMM: REALMT: t_.:REALMM:
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:speed.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:consumerfrac.sc
[ reached getOption("max.print") -- omitted 9 rows ]
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-5.78006527 -0.36573591 0.04098243 0.55898457 6.73978237
Number of Observations: 42586
Number of Groups:
STUDY_ID rarefyID %in% STUDY_ID
218 42586
# simplify
if(file.exists('temp/modTfullJbetasimp.rds')){
modTfullJbetasimp <- readRDS('temp/modTfullJbetasimp.rds')
} else {
require(MASS) # for stepAIC
modTfullJbetaml <- update(modTfullJbeta, method = 'ML')
modTfullJbetasimp <- stepAIC(modTfullJbetaml, direction = 'backward')
saveRDS(modTfullJbetasimp, file = 'temp/modTfullJbetasimp.rds')
}
if(file.exists('temp/modTfullHornsimp.rds')){
modTfullHornsimp <- readRDS('temp/modTfullHornsimp.rds')
} else {
require(MASS) # for stepAIC
modTfullHornml <- update(modTfullHorn, method = 'ML')
modTfullHornsimp <- stepAIC(modTfullHornml, direction = 'backward')
saveRDS(modTfullHornsimp, file = 'temp/modTfullHornsimp.rds')
}
summary(modTfullJbetasimp)
Linear mixed-effects model fit by maximum likelihood
Data: trends[i2, ]
Random effects:
Formula: ~temptrend_abs.sc | STUDY_ID
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.06485034 (Intr)
temptrend_abs.sc 0.02424001 0.542
Formula: ~1 | rarefyID %in% STUDY_ID
(Intercept) Residual
StdDev: 0.002184697 0.3556416
Variance function:
Structure: Power of variance covariate
Formula: ~nyrBT
Parameter estimates:
power
-1.375443
Fixed effects: Jbetatrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc + seas.sc + microclim.sc + mass.sc + speed.sc + lifespan.sc + consumerfrac.sc + endothermfrac.sc + nspp.sc + temptrend.sc + thermal_bias.sc + npp.sc + human.sc + temptrend_abs.sc:REALM + temptrend_abs.sc:tempave.sc + temptrend_abs.sc:tempave_metab.sc + temptrend_abs.sc:seas.sc + temptrend_abs.sc:microclim.sc + temptrend_abs.sc:mass.sc + temptrend_abs.sc:speed.sc + temptrend_abs.sc:lifespan.sc + temptrend_abs.sc:endothermfrac.sc + temptrend_abs.sc:nspp.sc + temptrend.sc:thermal_bias.sc + temptrend_abs.sc:npp.sc + temptrend_abs.sc:human.sc + REALM:human.sc + temptrend_abs.sc:REALM:human.sc
Correlation:
(Intr) tmpt_. REALMMr REALMTr tmpv.s tmpv_. ses.sc mcrcl. mss.sc spd.sc lfspn. cnsmr. endth. nspp.s
temptrend_abs.sc 0.356
REALMMarine -0.917 -0.326
REALMTerrestrial -0.887 -0.321 0.813
tempave.sc -0.002 -0.007 -0.009 -0.005
tempave_metab.sc 0.039 0.011 -0.030 -0.029 -0.262
seas.sc -0.027 -0.003 0.039 -0.002 0.282 -0.083
microclim.sc -0.004 0.002 0.010 -0.007 0.063 0.067 0.189
mass.sc 0.019 0.004 -0.006 -0.007 0.001 -0.550 -0.041 -0.013
speed.sc 0.013 0.003 -0.023 -0.016 -0.004 0.178 -0.080 -0.037 -0.137
lifespan.sc 0.024 0.013 -0.014 -0.026 -0.037 0.757 0.095 0.049 -0.801 0.278
consumerfrac.sc -0.039 -0.038 0.052 0.304 -0.032 -0.055 0.005 0.014 0.047 -0.115 -0.090
endothermfrac.sc 0.153 0.070 -0.074 -0.310 0.056 -0.135 0.044 0.004 0.027 0.055 -0.022 -0.411
nspp.sc -0.020 0.001 -0.001 -0.010 -0.048 -0.034 -0.026 -0.060 -0.150 -0.048 0.086 0.005 0.045
temptrend.sc -0.004 -0.007 0.004 0.006 -0.065 -0.019 -0.048 -0.017 0.015 -0.010 -0.012 0.010 0.004 0.020
thermal_bias.sc 0.022 -0.006 -0.033 -0.008 0.759 -0.033 -0.152 -0.126 0.038 0.018 -0.066 -0.005 -0.004 -0.112
npp.sc 0.002 -0.001 -0.006 -0.004 -0.322 0.245 -0.264 -0.222 -0.012 -0.025 0.062 -0.056 -0.084 -0.166
human.sc -0.133 -0.011 0.125 0.119 0.019 -0.009 0.013 0.017 0.003 0.001 0.005 0.012 0.000 -0.009
temptrend_abs.sc:REALMMarine -0.337 -0.953 0.358 0.303 0.006 -0.004 0.011 0.000 0.002 -0.006 -0.008 0.037 -0.040 -0.008
temptrend_abs.sc:REALMTerrestrial -0.317 -0.895 0.289 0.341 -0.003 0.001 -0.015 -0.009 -0.001 0.007 0.000 0.074 -0.104 -0.016
temptrend_abs.sc:tempave.sc 0.000 -0.005 -0.002 -0.005 0.108 -0.063 0.051 -0.025 -0.033 -0.030 0.004 -0.015 0.019 -0.003
temptrend_abs.sc:tempave_metab.sc 0.004 0.022 0.000 0.008 0.031 0.350 0.013 0.086 -0.217 0.084 0.316 0.001 -0.067 -0.028
temptrend_abs.sc:seas.sc 0.009 -0.025 -0.005 -0.012 0.159 0.025 0.234 0.026 -0.035 -0.031 0.040 0.034 0.005 -0.009
temptrend_abs.sc:microclim.sc -0.002 -0.023 0.000 -0.002 0.011 0.101 0.055 0.278 -0.029 0.009 0.019 0.001 -0.027 -0.001
temptrend_abs.sc:mass.sc 0.003 0.005 0.002 0.001 -0.012 -0.289 -0.034 -0.021 0.496 -0.052 -0.408 0.024 0.013 -0.060
temptrend_abs.sc:speed.sc -0.009 -0.014 0.008 0.019 -0.008 0.027 -0.030 0.004 -0.017 0.217 0.059 0.015 -0.002 -0.025
temptrend_abs.sc:lifespan.sc 0.002 0.024 0.002 0.008 -0.003 0.406 0.050 0.025 -0.409 0.117 0.507 -0.016 -0.056 0.039
temptrend_abs.sc:endothermfrac.sc 0.053 0.134 -0.024 -0.091 -0.031 -0.095 -0.003 -0.039 0.012 -0.006 -0.048 -0.090 0.359 0.047
temptrend_abs.sc:nspp.sc 0.000 0.031 -0.005 -0.011 -0.037 -0.012 0.004 0.003 -0.067 0.000 0.056 -0.008 0.020 0.334
tmptr. thrm_. npp.sc hmn.sc tm_.:REALMM tm_.:REALMT tmptrnd_bs.sc:t. t_.:_. tmptrnd_bs.sc:ss.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc -0.001
npp.sc -0.014 -0.135
human.sc 0.009 0.015 -0.034
temptrend_abs.sc:REALMMarine 0.005 0.005 -0.005 0.011
temptrend_abs.sc:REALMTerrestrial 0.006 0.003 0.014 0.011 0.845
temptrend_abs.sc:tempave.sc -0.077 0.008 -0.034 -0.003 0.004 -0.002
temptrend_abs.sc:tempave_metab.sc 0.002 0.098 0.029 -0.001 -0.013 0.000 -0.649
temptrend_abs.sc:seas.sc -0.033 0.101 -0.181 -0.001 0.045 -0.034 0.248 -0.014
temptrend_abs.sc:microclim.sc 0.000 -0.022 -0.126 0.001 0.033 -0.005 -0.023 0.000 0.060
temptrend_abs.sc:mass.sc 0.019 0.016 0.006 0.011 0.006 0.004 -0.054 -0.407 -0.027
temptrend_abs.sc:speed.sc -0.003 0.011 0.008 0.011 -0.007 0.048 -0.042 0.074 -0.050
temptrend_abs.sc:lifespan.sc -0.015 -0.015 0.019 -0.006 -0.017 0.000 -0.005 0.624 0.052
temptrend_abs.sc:endothermfrac.sc -0.008 -0.066 -0.022 -0.002 -0.082 -0.242 0.401 -0.430 0.014
temptrend_abs.sc:nspp.sc 0.022 -0.069 -0.028 -0.013 -0.048 -0.063 0.044 -0.020 -0.046
tmptrnd_bs.sc:mc. tmptrnd_bs.sc:ms. tmptrnd_bs.sc:sp. tmptrnd_bs.sc:l. tmptrnd_bs.sc:nd.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc 0.015
temptrend_abs.sc:speed.sc -0.046 -0.048
temptrend_abs.sc:lifespan.sc 0.017 -0.792 0.130
temptrend_abs.sc:endothermfrac.sc 0.003 -0.010 0.076 -0.073
temptrend_abs.sc:nspp.sc -0.177 -0.208 -0.145 0.177 0.108
tmptrnd_bs.sc:ns. tm.:_. tmptrnd_bs.sc:np. tmptrnd_bs.sc:h. REALMM: REALMT: t_.:REALMM:
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
speed.sc
lifespan.sc
consumerfrac.sc
endothermfrac.sc
nspp.sc
temptrend.sc
thermal_bias.sc
npp.sc
human.sc
temptrend_abs.sc:REALMMarine
temptrend_abs.sc:REALMTerrestrial
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:microclim.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:speed.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:endothermfrac.sc
temptrend_abs.sc:nspp.sc
[ reached getOption("max.print") -- omitted 7 rows ]
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-6.8573436 -0.2341121 0.1401190 0.6510143 7.5263164
Number of Observations: 43585
Number of Groups:
STUDY_ID rarefyID %in% STUDY_ID
250 43585
summary(modTfullHornsimp)
Linear mixed-effects model fit by maximum likelihood
Data: trends[i3, ]
Random effects:
Formula: ~temptrend_abs.sc | STUDY_ID
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.06476501 (Intr)
temptrend_abs.sc 0.01910837 0.582
Formula: ~1 | rarefyID %in% STUDY_ID
(Intercept) Residual
StdDev: 0.004350937 0.3182529
Variance function:
Structure: Power of variance covariate
Formula: ~nyrBT
Parameter estimates:
power
-1.238924
Fixed effects: Horntrend ~ temptrend_abs.sc + REALM + tempave.sc + tempave_metab.sc + seas.sc + microclim.sc + mass.sc + lifespan.sc + endothermfrac.sc + nspp.sc + npp.sc + human.sc + temptrend_abs.sc:tempave.sc + temptrend_abs.sc:tempave_metab.sc + temptrend_abs.sc:seas.sc + temptrend_abs.sc:mass.sc + temptrend_abs.sc:lifespan.sc + temptrend_abs.sc:endothermfrac.sc + temptrend_abs.sc:nspp.sc + temptrend_abs.sc:npp.sc + temptrend_abs.sc:human.sc + REALM:human.sc
Correlation:
(Intr) tmpt_. REALMMr REALMTr tmpv.s tmpv_. ses.sc mcrcl. mss.sc lfspn. endth. nspp.s npp.sc hmn.sc
temptrend_abs.sc 0.115
REALMMarine -0.895 0.059
REALMTerrestrial -0.906 -0.043 0.815
tempave.sc -0.038 -0.010 0.032 0.022
tempave_metab.sc 0.047 0.033 -0.030 -0.028 -0.453
seas.sc -0.036 -0.002 0.043 0.008 0.542 -0.089
microclim.sc -0.008 0.000 0.012 -0.008 0.197 0.037 0.110
mass.sc 0.026 0.021 -0.012 -0.018 -0.057 -0.513 -0.051 -0.004
lifespan.sc 0.027 0.037 -0.008 -0.011 0.027 0.722 0.108 0.039 -0.802
endothermfrac.sc 0.150 0.049 -0.064 -0.225 0.147 -0.213 0.046 0.014 0.039 -0.065
nspp.sc -0.024 -0.035 -0.004 -0.009 0.049 -0.020 -0.051 -0.068 -0.168 0.109 0.061
npp.sc 0.012 -0.002 -0.013 0.000 -0.328 0.258 -0.301 -0.261 -0.008 0.049 -0.108 -0.172
human.sc -0.112 -0.023 0.102 0.100 0.014 -0.003 0.015 0.030 0.000 0.013 0.009 -0.010 -0.037
temptrend_abs.sc:tempave.sc 0.001 -0.013 -0.003 0.000 0.093 -0.049 0.013 -0.016 -0.044 0.015 0.026 0.000 -0.013 -0.006
temptrend_abs.sc:tempave_metab.sc -0.007 0.056 0.016 0.009 -0.038 0.299 0.045 0.100 -0.188 0.280 -0.076 -0.012 0.022 0.013
temptrend_abs.sc:seas.sc 0.012 -0.035 -0.030 -0.007 0.071 0.035 0.188 0.009 -0.038 0.051 -0.023 -0.011 -0.145 -0.005
temptrend_abs.sc:mass.sc 0.014 0.043 -0.008 -0.013 -0.045 -0.247 -0.039 -0.021 0.444 -0.372 0.019 -0.054 0.013 -0.012
temptrend_abs.sc:lifespan.sc -0.008 0.060 0.021 0.015 0.022 0.343 0.053 0.011 -0.366 0.454 -0.060 0.043 0.011 0.011
temptrend_abs.sc:endothermfrac.sc 0.004 -0.041 -0.005 0.005 0.023 -0.107 -0.043 -0.069 0.005 -0.055 0.304 0.043 -0.006 0.006
temptrend_abs.sc:nspp.sc -0.030 -0.098 0.020 0.025 0.013 0.009 -0.014 0.057 -0.061 0.053 0.000 0.283 -0.036 0.003
temptrend_abs.sc:npp.sc 0.023 -0.049 -0.028 -0.015 -0.105 0.117 -0.145 -0.101 0.011 0.010 -0.054 -0.018 0.308 -0.007
temptrend_abs.sc:human.sc -0.013 0.008 0.020 0.012 0.001 -0.019 -0.022 -0.042 0.009 -0.006 0.019 -0.029 -0.039 0.029
REALMMarine:human.sc 0.113 0.024 -0.103 -0.100 -0.020 0.003 -0.025 -0.037 0.001 -0.015 -0.009 0.008 0.024 -0.998
REALMTerrestrial:human.sc 0.112 0.023 -0.102 -0.100 -0.033 0.007 -0.031 -0.016 0.005 -0.019 -0.014 0.013 0.034 -0.997
tmptrnd_bs.sc:t. t_.:_. tmptrnd_bs.sc:s. tmptrnd_bs.sc:m. tmptrnd_bs.sc:l. tmptrnd_bs.sc:nd. tmptrnd_bs.sc:ns.
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
lifespan.sc
endothermfrac.sc
nspp.sc
npp.sc
human.sc
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc -0.667
temptrend_abs.sc:seas.sc 0.150 0.043
temptrend_abs.sc:mass.sc -0.065 -0.408 -0.023
temptrend_abs.sc:lifespan.sc 0.001 0.616 0.060 -0.808
temptrend_abs.sc:endothermfrac.sc 0.551 -0.577 -0.083 -0.020 -0.099
temptrend_abs.sc:nspp.sc 0.053 -0.004 -0.036 -0.221 0.217 0.128
temptrend_abs.sc:npp.sc -0.163 0.145 -0.233 -0.023 0.051 -0.078 -0.258
temptrend_abs.sc:human.sc -0.176 0.100 -0.175 0.034 -0.033 -0.076 -0.093
REALMMarine:human.sc 0.004 -0.012 0.002 0.013 -0.011 -0.006 -0.004
REALMTerrestrial:human.sc 0.007 -0.015 0.001 0.014 -0.013 -0.005 -0.001
tmptrnd_bs.sc:np. tmptrnd_bs.sc:h. REALMM:
temptrend_abs.sc
REALMMarine
REALMTerrestrial
tempave.sc
tempave_metab.sc
seas.sc
microclim.sc
mass.sc
lifespan.sc
endothermfrac.sc
nspp.sc
npp.sc
human.sc
temptrend_abs.sc:tempave.sc
temptrend_abs.sc:tempave_metab.sc
temptrend_abs.sc:seas.sc
temptrend_abs.sc:mass.sc
temptrend_abs.sc:lifespan.sc
temptrend_abs.sc:endothermfrac.sc
temptrend_abs.sc:nspp.sc
temptrend_abs.sc:npp.sc
temptrend_abs.sc:human.sc -0.093
REALMMarine:human.sc 0.002 -0.007
REALMTerrestrial:human.sc 0.008 -0.033 0.995
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-5.77663334 -0.36634606 0.04052091 0.55819364 6.71061228
Number of Observations: 42586
Number of Groups:
STUDY_ID rarefyID %in% STUDY_ID
218 42586
if(file.exists('temp/modTfullJbetasimpreml.rds')){
modTfullJbetasimpreml <- readRDS('temp/modTfullJbetasimpreml.rds')
} else {
modTfullJbetasimpreml <- update(modTfullJbetasimp, method = 'REML')
saveRDS(modTfullJbetasimpreml, file = 'temp/modTfullJbetasimpreml.rds')
}
if(file.exists('temp/modTfullHornsimpreml.rds')){
modTfullHornsimpreml <- readRDS('temp/modTfullJbetasimpreml.rds')
} else {
modTfullHornsimpreml <- update(modTfullHornsimp, method = 'REML')
saveRDS(modTfullHornsimpreml, file = 'temp/modTfullHornsimpreml.rds')
}
# plot coefs
coefs2 <- summary(modTfullJbetasimpreml)$tTable
coefs3 <- summary(modTfullHornsimpreml)$tTable
varstoplot <- unique(c(rownames(coefs2), rownames(coefs3)))
rows1 <- which(!grepl('Intercept|REALM', varstoplot) | grepl(':', varstoplot)) # vars to plot in first graph
rows1_2 <- which(rownames(coefs2) %in% varstoplot[rows1]) # rows in coefs2
rows1_3 <- which(rownames(coefs3) %in% varstoplot[rows1]) # rows in coefs3
xlims1 <- range(c(coefs2[rows1_2,1] - coefs2[rows1_2,2],
coefs2[rows1_2,1] + coefs2[rows1_2,2],
coefs3[rows1_3,1] - coefs3[rows1_3,2],
coefs3[rows1_3,1] + coefs3[rows1_3,2]))
rows2 <- which(grepl('REALM', varstoplot) & !grepl(':', varstoplot)) # vars to plot in 2nd graph
rows2_2 <- which(rownames(coefs2) %in% varstoplot[rows2]) # rows in coefs2
rows2_3 <- which(rownames(coefs3) %in% varstoplot[rows2]) # rows in coefs3
xlims2 <- range(c(coefs2[rows2_2,1] - coefs2[rows2_2,2],
coefs2[rows2_2,1] + coefs2[rows2_2,2],
coefs3[rows2_3,1] - coefs3[rows2_3,2],
coefs3[rows2_3,1] + coefs3[rows2_3,2]))
cols <- c('black', 'grey') # for Jbeta and Horn models, respectively
offs <- 0.1 # offset vertically for the two models
par(mfrow=c(1,2), las = 1, mai = c(0.5, 3, 0.1, 0.1))
plot(0,0, col = 'white', xlim=xlims1, ylim = c(1,length(rows1)), yaxt='n', xlab = '', ylab ='')
axis(2, at = length(rows1):1, labels = varstoplot[rows1], cex.axis = 0.7)
abline(v = 0, col = 'grey')
for(i in 1:length(rows1)){
if(varstoplot[rows1[i]] %in% rownames(coefs2)){
x = coefs2[rownames(coefs2) == varstoplot[rows1[i]], 1]
se = coefs2[rownames(coefs2) == varstoplot[rows1[i]], 2]
points(x, length(rows1) + 1 - i + offs, pch = 16, col = cols[1])
lines(x = c(x-se, x+se), y = c(length(rows1) + 1 - i + offs, length(rows1) + 1 - i + offs), col = cols[1])
}
if(varstoplot[rows1[i]] %in% rownames(coefs3)){
x = coefs3[rownames(coefs3) == varstoplot[rows1[i]], 1]
se = coefs3[rownames(coefs3) == varstoplot[rows1[i]], 2]
points(x, length(rows1) + 1 - i - offs, pch = 16, col = cols[2])
lines(x = c(x-se, x+se), y = c(length(rows1) + 1 - i - offs, length(rows1) + 1 - i - offs), col = cols[2])
}
}
plot(0,0, col = 'white', xlim=xlims2, ylim = c(1,length(rows2)), yaxt='n', xlab = '', ylab ='')
axis(2, at = length(rows2):1, labels = varstoplot[rows2], cex.axis = 0.7)
abline(v = 0, col = 'grey')
for(i in 1:length(rows2)){
if(varstoplot[rows2[i]] %in% rownames(coefs2)){
x = coefs2[rownames(coefs2) == varstoplot[rows2[i]], 1]
se = coefs2[rownames(coefs2) == varstoplot[rows2[i]], 2]
points(x, length(rows2) + 1 - i + offs, pch = 16, col = cols[1])
lines(x = c(x-se, x+se), y = c(length(rows2) + 1 - i + offs, length(rows2) + 1 - i + offs), col = cols[1])
}
if(varstoplot[rows2[i]] %in% rownames(coefs3)){
x = coefs3[rownames(coefs3) == varstoplot[rows2[i]], 1]
se = coefs3[rownames(coefs3) == varstoplot[rows2[i]], 2]
points(x, length(rows2) + 1 - i - offs, pch = 16, col = cols[2])
lines(x = c(x-se, x+se), y = c(length(rows2) + 1 - i - offs, length(rows2) + 1 - i - offs), col = cols[2])
}
}
Black is for Jaccard total turnover (pres/abs), grey is for Morisita-Horn turnover (considers abundance)